<include file="Index/header" />

<div class="container">
	<table class="table table-hover table-bordered">
		<thead>
			<tr>
				<th> 购物车编号 </th>
				<th> 分类编号 </th>
				<th> 商品编号 </th>
				<th> 商品图片 </th>
				<th> 商品名称 </th>
				<th> 商品价格 </th>
				<th> 操作 </th>
			</tr>
		</thead>
		<tbody>
			<notempty name='car_info' value="">
				<!--如果用户存在 -->
				<foreach name="car_info" item="userInfo">
					<notempty name='userInfo.Car' value="">
						<!--如果用户购物车有信息 -->
						<foreach name="userInfo.Car" item="info">
							<tr>
								<td> {$info['car_id']}</td>
								<td>{$info['goods_id']} </td>
								<td>{$info['goods_id']} </td>
								<td> <img class="img-rounded" src="__PUBLIC__/images/goods/{$info[pic_url]}"
										width="64px" height="64px" alt="{$info['goods_name']}"> </td>
								<td><a href="?m=Home&c=goods&a=item&gi={$info[goods_id]}">{$info['goods_name']}</a>
								</td>
								<td class="place">￥{$info['goods_price']} </td>
								<td>
									<a href="?m=Home&c=order&a=order&gi={$info[goods_id]}"
										class="btn  btn-primary  ">立即购买</a>
									<a href="#" class="btn   btn-danger " onclick="centainDelete()">移出购物车</a>
								</td>
							</tr>
						</foreach>
					</notempty>
				</foreach>
			</notempty>
		</tbody>
	</table>
</div>
<br />
<br />
<script type="text/javascript">
	function centainDelete() {
		if (window.confirm("确定要将该商品移除购物车吗?")) {
			location.href = "?m=Home&c=car&a=delete&cai={$info[car_id]}";
		}
	}
</script>
<include file="Index/footer" />